<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>05_Promise相关面试题</title>
</head>
<body>
  
  <script type="text/javascript">
    setTimeout( () => {
      console.log(1);
    }, 0)
    new Promise( (resolve) => {
      console.log(2);
      resolve()
    }).then( () => {
      console.log(3);
    }).then( () => {
      console.log(4);
    })
    console.log(5);
  </script>


  <!-- 
    同步执行        2 5 

    异步执行回调
    宏: [1]
    微: [3]
    --------------
    执行微任务        3
    宏: [1]
    微: [4]
    --------------
    执行微任务        4
    宏: [1]
    微: []
    --------------
    执行宏任务        1
    宏: []
    微: []
  -->


</body>
</html>